home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Dynamo 4.2 for GSBug 1.5b10 / dynamo.sample / sample.a < prev    next >
Encoding:
Text File  |  1990-09-21  |  14.2 KB  |  774 lines  |  [TEXT/MPS ]

  1. *******************************************************
  2. *                        *
  3. * Apple II 8-bit runtime sample exerciser.        *
  4. * Copyright (C) 1990 Apple Computer.        *
  5. * Version 4.1                    *
  6. *                        *
  7. * Written by Eric Soldan, Apple II DTS        *
  8. *                        *
  9. *******************************************************
  10.  
  11.         include    ':dynamo.includes:sys.equ'
  12.         include    ':dynamo.includes:rt.h'
  13.         include    ':dynamo.includes:rt.macros'
  14.         include    ':dynamo.includes:rtfp.macros'
  15.  
  16.         include    'app.config'
  17.  
  18. *********************************************
  19.  
  20.         export    intspace
  21. intspace        PROC
  22.         export    floatspace
  23. floatspace    ds.b    256
  24.         endp
  25.  
  26. ******************
  27.  
  28.         export    strspace
  29. strspace        PROC
  30.         export    strlens, maxstrlens, strlocs
  31. strlens        ds.b    numstrings
  32. maxstrlens    dc.b    maxstr1, maxstr2
  33. strlocs        dc.w    str1loc, str2loc
  34.         endp
  35.  
  36. ******************
  37.  
  38. part1        PROC
  39.         export    start
  40.         import    part2
  41.  
  42.         jsr    $C300        ;Initialize 80-col screen.
  43.         _writecr
  44.         jsr    home
  45.  
  46. start        lda    #0        ;Clear the variable space.
  47.         tax            ;This application does not
  48. @clearvars    sta    intspace,x    ;need the variables to be
  49.         inx            ;pre-cleared.
  50.         bne    @clearvars
  51.  
  52.         jmp    part2
  53.  
  54.         endp
  55.  
  56. ******************
  57.  
  58. part2        PROC
  59.  
  60.         _rtreset
  61.         _hibitchrs
  62.  
  63.         _write    '8-bit sample application demonstrating ',\
  64.             'macros and runtime.',13,\
  65.             'Copyright (C) 1990 by Apple Computer.',13,\
  66.             '<<< Version 4.1 >>>'
  67.  
  68.         _signed
  69.         _write    13,13,13,13,'  Testing signed output:  '
  70.         _decout    #-1
  71.         _unsigned
  72.         _write    13,'Testing unsigned output:  '
  73.         _decout    #-1
  74.  
  75.         _write    13,13,'  Testing 1-byte decimal output:  '
  76.         _decoutl    #-1
  77.         _write    13,'Testing variable decimal output:  '
  78.  
  79.         _restore    #intdata
  80.         _readint    var1
  81.         _vdecout
  82.  
  83.         _write    13,13,'           hexpad default is to pad with 0''s:  '
  84.         _vhexout
  85.         _hexnopad
  86.         _write    13,'       Testing 2-byte hex output with no pad:  '
  87.         _hexout    #123
  88.         _hexpad    #32
  89.         _write    13,'Testing 2-byte hex output padded with spaces:  '
  90.         _hexout    #123
  91.  
  92.  
  93.         _hexpad    #'0'
  94.         _writecr
  95.         _write    13,'   Testing 1-byte hex output padded with 0''s:  '
  96.         _hexoutl    #15
  97.         _hexnopad
  98.         _write    13,'       Testing 1-byte hex output with no pad:  '
  99.         _hexoutl    #15
  100.         _hexpad    #32
  101.         _write    13,'Testing 1-byte hex output padded with spaces:  '
  102.         _hexoutl    #15
  103.         
  104.         jsr    nextPage
  105.  
  106.         _write    'Testing _addvar:  1234+5678='
  107.         _set    var2,#5678
  108.         _set    var1,#1234
  109.         _addvar    ,var2
  110.         _vdecout
  111.         _write    13,'  Testing _addl:  +123='
  112.         _addl    ,#123
  113.         _vdecout
  114.         _write    13,'   Testing _add:  +456='
  115.         _add    ,#456
  116.         _vdecout
  117.  
  118.         _write    13,13,'Testing _subvar:  5678-1234='
  119.         _set    var2,#1234
  120.         _set    var1,#5678
  121.         _subvar    ,var2
  122.         _vdecout
  123.         _write    13,'  Testing _subl:  -123='
  124.         _subl    ,#123
  125.         _vdecout
  126.         _write    13,'   Testing _sub:  -456='
  127.         _sub    ,#456
  128.         _vdecout
  129.  
  130.         _write    13,13,'Testing _mulvar:  12*345='
  131.         _set    var2,#345
  132.         _set    var1,#<12
  133.         _mulvar    ,var2
  134.         _vdecout
  135.         _write    13,'  Testing _mull:  *6='
  136.         _mull    ,#6
  137.         _vdecout
  138.         _write    13,'   Testing _mul:  *789='
  139.         _mul    ,#789
  140.         _vdecout
  141.         _write    '   (Overflow -- loss of high-order bytes.)'
  142.  
  143.         _write    13,13,'Testing _divvar:  65432/23='
  144.         _set    var2,#<23
  145.         _set    var1,#65432
  146.         _divvar    ,var2
  147.         _set    remainder
  148.         _vdecout    var1
  149.         _write    '  (Remainder='
  150.         _vdecout    remainder
  151.         _rtcout    #')'
  152.         _write    13,'  Testing _divl:  /34='
  153.         _divl    var1,#34
  154.         _set    remainder
  155.         _vdecout    var1
  156.         _write    '         (Remainder='
  157.         _vdecout    remainder
  158.         _rtcout    #')'
  159.         _write    13,'   Testing _div:  /321='
  160.         _div    var1,#321
  161.         _set    remainder
  162.         _vdecout    var1
  163.         _write    '         (Remainder='
  164.         _vdecout    remainder
  165.         _rtcout    #')'
  166.  
  167.         _write    13,13,'Testing dereferencing ($1234 means good):  $'
  168.         _set    var1,**@ptr1        ;var1 has address @ptr3 now.
  169.         _add    ,#<2            ;var1 has address @ptr3+2 now.
  170.         _vderef                ;var1 has address @ptr4 now.
  171.         _vderef                ;var1 has address @ptr5 now.
  172.         _vderef                ;var1 has value from @ptr5 now.
  173.         _vhexout
  174.         jmp    @past
  175.  
  176. @ptr1        dc.w    @ptr2
  177. @ptr2        dc.w    @ptr3
  178. @ptr3        dc.w    0,@ptr4
  179. @ptr4        dc.w    @ptr5
  180. @ptr5        dc.w    $1234
  181.  
  182. @past        jsr    nextPage
  183.  
  184.         _set    var1,#345
  185.         _set0    var1
  186.         _write    'Testing _set0:  '
  187.         _vdecout
  188.         _set    var2,#<2
  189.         _var    var1
  190.         _varcpy    ,var2
  191.         _write    13,'Testing _var and _varcpy (2 means good):  '
  192.         _vdecout
  193.         _set    var1,#345
  194.         _setl    ,#123
  195.         _write    13,'Testing _setl (123 means good):  '
  196.         _vdecout
  197.         _write    13,'Testing _setvars:  '
  198.         _setvars    var1,#123,var2,#456,var3,#789
  199.         _vdecout    var1
  200.         _rtcout    #','
  201.         _vdecout    var2
  202.         _rtcout    #','
  203.         _vdecout    var3
  204.  
  205.         _write    13,13,'  Testing _maxswap (signed):  '
  206.         _set    var1,#-123
  207.         _signed
  208.         _maxswap    var1,var2
  209.         _vdecout
  210.         _rtcout    #','
  211.         _vdecout    var2
  212.         _write    13,'Testing _maxswap (unsigned):  '
  213.         _unsigned
  214.         _maxswap    var1,var2
  215.         _signed
  216.         _vdecout
  217.         _rtcout    #','
  218.         _vdecout    var2
  219.  
  220.         _write    13,'Testing _minswap (unsigned):  '
  221.         _unsigned
  222.         _minswap    var1,var2
  223.         _signed
  224.         _vdecout
  225.         _rtcout    #','
  226.         _vdecout    var2
  227.         _write    13,'  Testing _minswap (signed):  '
  228.         _minswap    var1,var2
  229.         _vdecout
  230.         _rtcout    #','
  231.         _vdecout    var2
  232.         _unsigned
  233.  
  234.         _write    13,13,'Testing _vsgncmp:  -123<456?:  '
  235.         _setvars    var1,#-123,var2,#456
  236.         _vsgncmp    var1,var2
  237.         bcc    @a
  238.         _write    'no'
  239.         jmp    @b
  240. @a        _write    'yes'
  241. @b        _write    13,'   Testing _vcmp:  -123<456?:  '
  242.         _vcmp    var1,var2
  243.         bcc    @c
  244.         _write    'no'
  245.         jmp    @d
  246. @c        _write    'yes'
  247. @d        _write    13,' Testing _sgncmp:  -123<456?:  '
  248.         _sgncmp    var1,#456
  249.         bcc    @e
  250.         _write    'no'
  251.         jmp    @f
  252. @e        _write    'yes'
  253. @f        _write    13,'    Testing _cmp:  -123<456?:  '
  254.         _cmp    var1,#456
  255.         bcc    @g
  256.         _write    'no'
  257.         jmp    @h
  258. @g        _write    'yes'
  259. @h
  260.  
  261.         _readend    #0
  262.         _restore    #strdata
  263.         _readstr    str1
  264.         _prstr
  265.         _readstr    str2
  266.         _strval
  267.         _decout
  268.  
  269.         _readstr    str1
  270.         _prstr
  271.         _midstrval str2,#2
  272.         _decout
  273.  
  274.         _writecr
  275.         _readstr   str1
  276.         _prleftstr str1,#10
  277.         _prmidstr  str1,#10,#5
  278.         _prmidstr  str1,#15,#255
  279.  
  280.         _writecr
  281.         _readstr    str1
  282.         _leftstrcpy str2,str1,#15
  283.         _prstr
  284.         _midstrcpy  ,str1,#15,#5
  285.         _prstr
  286.         _midstrcpy  ,str1,#20
  287.         _prstr
  288.  
  289.         _writecr
  290.         _readstr    str1
  291.         _strcpy    str2,str1
  292.         _prstr
  293.  
  294.         _writecr
  295.         _readstr    str2
  296.         _readstr    str1
  297.  
  298.         _leftstrcat str2,str1,#10
  299.         _midstrcat  ,str1,#10,#5
  300.         _midstrcat  ,str1,#15
  301.         _prstr
  302.  
  303.         _writecr
  304.         _readstr    str1
  305.         _readstr    str2
  306.  
  307.         _strcat    str1,str2
  308.         _prstr
  309.  
  310.         jsr    nextPage
  311.  
  312.         _readstr    str1
  313.         ldy    #0
  314. @loop        cpy    strlens+str1
  315.         beq    @brkloop
  316.         tya
  317.         pha
  318.         _strchr
  319.         _rtcout
  320.         pla
  321.         tay
  322.         iny
  323.         bne    @loop
  324. @brkloop
  325.  
  326.         _litstr    str1,13,'Testing _litstr.'
  327.         _prstr
  328.         _write    13,'Testing _strloc:  str1 is at $'
  329.         _strloc    str1
  330.         _hexout
  331.  
  332.         _write    13,13,'Testing _rndseed:  value passed is:  $'
  333.         _hexnopad
  334.         _hexout    *rndl
  335.         _rndseed    *rndl
  336.         _write    13,13,'Testing _random (200 numbers from 0 to 99):',13,13
  337.         ldx    #10
  338. @loopx        stx    tempx
  339.         ldy    #20
  340. @loopy        sty    tempy
  341.         _random    #100        ;This random generator can not generate
  342.         _decout            ;a zero value.  This is okay, since you
  343.         lda    #','        ;can't declare a limit in 2 bytes which
  344.         ldy    tempy        ;would give you this range.  (To get a
  345.         dey            ;high-end value of 65535, you would have
  346.         bne    @i        ;to have a limit of 65536.
  347.         lda    #13        ;Adjustments for the algorithm not
  348. @i        _rtcout            ;generating a 0 value have been made.
  349.         ldy    tempy        ;1 is subtracted from the value, thus
  350.         dey            ;moving the problem value from 0 to 65535.
  351.         bne    @loopy        ;Since there is a limit on the 65535 value
  352.         ldx    tempx        ;anyway, due to not being able to declare
  353.         dex            ;a limit of 65536, this works rather well.
  354.         bne    @loopx
  355.  
  356.         jsr    nextPage
  357.  
  358.         _write    13,'Testing array handling.'
  359.         _write    13,'The array is 2x512x2x4 words.'
  360.  
  361.         _array    #$4000,#2,#2,#512,#2,#4
  362.  
  363.         _index    #<1,#379,#<1
  364.         _set    var1,#1234
  365.         _putl    ,#3
  366.  
  367.         _index    ,#<73
  368.         _set    var1,#567
  369.         _put    ,#<1
  370.  
  371.         _set    var1,#890
  372.         _putnext
  373.  
  374.         _write    13,13,'array(1,379,1,3)='
  375.         _index    ,#379,#<1
  376.         _getl    var1,#<3
  377.         _vdecout
  378.  
  379.         _write    13,'array(1, 73,0,1)='
  380.         _index    ,#<73
  381.         _get    var1,#<1
  382.         _vdecout
  383.  
  384.         _write    13,'array(1, 73,0,2)='
  385.         _getnext
  386.         _vdecout
  387.  
  388.         jsr    nextPage
  389.  
  390.         _write    'Testing floating-point support:',13
  391.         _write    13,'                   Ascii text for number is:  -123.4567e8'
  392.         _write    13,'    Ascii to float variable (testing _fset):  '
  393. floattest    _fset    fvar1,#-123.4567e8
  394.         _hexpad    #'0'
  395.         _hexoutl    *floattest+5
  396.         _rtcout    #' '
  397.         _hexoutl    *floattest+6
  398.         _rtcout    #' '
  399.         _hexoutl    *floattest+7
  400.         _rtcout    #' '
  401.         _hexoutl    *floattest+8
  402.         _rtcout    #' '
  403.         _hexoutl    *floattest+9
  404.         _write    13,'     Output float variable (testing _fvout):  '
  405.         _fvout
  406.         _write    13,'Output multi-deref''ed float (testing _fout):  '
  407.         _fout    ***@fp
  408.         jmp    @pastptrs
  409. @fp        dc.w    @fp0
  410. @fp0        dc.w    floattest+5
  411. @pastptrs
  412.  
  413.         _fset    fvar1,#.123
  414.         _fmul    ,#.456
  415.         _write    13,13,'Testing floating-point multiply:  ',\
  416.             '             .123 * .456 = '
  417.         _fvout
  418.  
  419.         _fsetvars fvar1,#.456,fvar2,#.123
  420.         _fdivvar    fvar1,fvar2
  421.         _write       13,'  Testing floating-point divide:  ',\
  422.             '             .456 / .123 = '
  423.         _fvout
  424.  
  425.         _fset    fvar1,#12.34567e8
  426.         _fadd    ,#.7654321e10
  427.         _write       13,'     Testing floating-point add:  ',\
  428.             '12.34567e8 + .7654321e10 = '
  429.         _fvout
  430.  
  431.         _fset    fvar1,#55.555e-4
  432.         _fsub    ,#.54321e-2
  433.         _write       13,'Testing floating-point subtract:  ',\
  434.             '   55.555e-4 - .54321e-2 = '
  435.         _fvout
  436.  
  437.         _i2fsetvars fvar1,#5,fvar2,#2
  438.         _fv2v    fvar1,fvar2
  439.         _write       13,'          Testing exponentation:  '
  440.         _repeat    #' ',#19
  441.         _write    '5 ^ 2 = '
  442.         _fvout
  443.  
  444.         _restore    #floatdata
  445.         _readfloat fvar1
  446.         _readfloat fvar2
  447.         _fv2v    fvar1,fvar2
  448.         _writecr
  449.         _space    #51
  450.         _write    '16 ^ .5 = '
  451.         _fvout
  452.         _fset    fvar1,#2.71828183
  453.         _fv2con    ,#3.14159265
  454.         _writecr
  455.         _space    #35
  456.         _write    '2.71828183 ^ 3.14159265 = '
  457.         _fvout
  458.  
  459.         _write    13,13,'AppleSoft floating-point numbers ',\
  460.             'will have slight rounding errors.  This is to ',13,\
  461.             'be expected.  (Try it in AppleSoft.)',13,13
  462.  
  463.         _write    ' Testing _fcmp:  -1.35e-9<-1.35e-8?:  '
  464.         _fset    fvar1,#-1.35e-9
  465.         _fcmp    ,#-1.35e-8
  466.         bcs    @a
  467.         _write    'yes'
  468.         jmp    @b
  469. @a        _write    'no'
  470. @b        _write    13,'Testing _fvcmp:  -1.35e-9>-1.35e-8?:  '
  471.         _fset    fvar2,#-1.35e-8
  472.         _fvcmp    fvar1,fvar2
  473.         beq    @c
  474.         bcc    @c
  475.         _write    'yes'
  476.         jmp    @d
  477. @c        _write    'no'
  478. @d
  479.         jsr    nextPage
  480.  
  481.         _write    'Testing float-to-int conversion:     ',\
  482.              'float      signed int     unsigned int',13
  483.         _space    #36
  484.         _write    '-------     ----------     ------------',13
  485.  
  486.         _space    #36
  487.         _fset    fvar1,#123.456
  488.         _fvout
  489.         _f2i
  490.         _signed
  491.         _space    #9
  492.         _vdecout
  493.         _unsigned
  494.         _space    #13
  495.         _vdecout
  496.  
  497.         _writecr
  498.         _space    #35
  499.         _fset    fvar1,#-123.456
  500.         _fvout
  501.         _f2i
  502.         _signed
  503.         _space    #8
  504.         _vdecout
  505.         _unsigned
  506.         _space    #11
  507.         _vdecout
  508.  
  509.         _writecr
  510.         _space    #38
  511.         _fset    fvar1,#65535
  512.         _fvout
  513.         _f2i
  514.         _signed
  515.         _space    #10
  516.         _vdecout
  517.         _unsigned
  518.         _space    #11
  519.         _vdecout
  520.  
  521.         _writecr
  522.         _space    #38
  523.         _fset    fvar1,#65536
  524.         _fvout
  525.         _f2i
  526.         _signed
  527.         _space    #11
  528.         _vdecout
  529.         _unsigned
  530.         _space    #15
  531.         _vdecout
  532.  
  533.         _write    13,13,'Testing _fsgn:  SGN(-123.456)='
  534.         _fset    fvar1,#-123.456
  535.         _fsgn
  536.         _fvout
  537.         _write    '        SGN(0)='
  538.         _fset0    fvar1
  539.         _fsgn
  540.         _fvout
  541.         _write    '   SGN(123.456)='
  542.         _fset    fvar1,#123.456
  543.         _fsgn
  544.         _fvout
  545.  
  546.         _write    13,'Testing _fabs:  ABS(-123.456)='
  547.         _fset    fvar1,#-123.456
  548.         _fabs
  549.         _fvout
  550.         _write    '   ABS(0)='
  551.         _fset0    fvar1
  552.         _fabs
  553.         _fvout
  554.         _write    '   ABS(123.456)='
  555.         _fset    fvar1,#123.456
  556.         _fabs
  557.         _fvout
  558.  
  559.         _write    13,'Testing _fint:  INT(-123.456)='
  560.         _fset    fvar1,#-123.456
  561.         _fint
  562.         _fvout
  563.         _write    '      INT(0)='
  564.         _fset0    fvar1
  565.         _fint
  566.         _fvout
  567.         _write    '   INT(123.456)='
  568.         _fset    fvar1,#123.456
  569.         _fint
  570.         _fvout
  571.  
  572.         _write    13,13,'Testing _fsqr:  SQR(64)='
  573.         _i2fset    fvar1,#64
  574.         _fsqr
  575.         _fvout
  576.         _write    '           SQR(123.456789)='
  577.         _fset    fvar1,#123.456789
  578.         _fsqr
  579.         _fvout
  580.  
  581.         _write    13,'Testing _flog:  LOG(2.71828183)='
  582.         _fset    fvar1,#2.71828183
  583.         _flog
  584.         _fvout
  585.         _write    '   LOG(123.456789)='
  586.         _fset    fvar1,#123.456789
  587.         _flog
  588.         _fvout
  589.  
  590.         _write    13,'Testing _fexp:  EXP(1)='
  591.         _i2fset    fvar1,#1
  592.         _fexp
  593.         _fvout
  594.         _write    '   EXP(10)='
  595.         _i2fset    fvar1,#10
  596.         _fexp
  597.         _fvout
  598.  
  599.         _write    13,13,'Testing _frnd:  RND(1)='
  600.         _rndseed    *rndl        ;Generate a random int seed.
  601.         _random    #32768
  602.         pha            ;Make it negative
  603.         tya
  604.         ora    #$80
  605.         tay
  606.         pla
  607.         _i2fset    fvar1
  608.         _frnd            ;Pass negative float to random for seed.
  609.         ldy    #3        ;Do 3 random numbers.
  610. @e        tya
  611.         pha
  612.         _rtcout    #' '
  613.         _i2fset    ,#1        ;We want a new random number.
  614.         _frnd
  615.         _fvout
  616.         pla
  617.         tay
  618.         dey
  619.         bne    @e        ;More random numbers to go.
  620.  
  621.         _write    13,13,'Testing _fcos:  COS(0)='
  622.         _i2fsetvars fvar1,#0,fvar2,#1
  623.         _fcos    fvar1
  624.         _fvout
  625.         _write    '   COS(pi/2)='
  626.         _fset    ,#1.57079633    ;This pi/2 gives the least error.
  627.         _fcos
  628.         _fvout
  629.  
  630.         _write    13,'Testing _fsin:  SIN(0)='
  631.         _fset0    ,#0
  632.         _fsin
  633.         _fvout
  634.         _write    '   SIN(pi/2)='
  635.         _fset    ,#1.57079633    ;This pi/2 gives the least error.
  636.         _fsin
  637.         _fvout
  638.  
  639.         _write    13,'Testing _ftan:  TAN(0)='
  640.         _fset0    ,#0
  641.         _ftan
  642.         _fvout
  643.         _write    '   TAN(pi/4)='
  644.         _fset    ,#.785398164
  645.         _ftan
  646.         _fvout
  647.  
  648.         _nullstr    str1        ;Empty the string.
  649.         _out2str            ;Testing output redirection to a string.
  650.         _out2str            ;Testing that the out2stroff can handle
  651.                     ;two calls to out2str.
  652.         _write    13,'Testing _fatn:  ATN(0)='
  653.         _fset0    fvar1,#0
  654.         _fatn
  655.         _fvout
  656.         _write    '   ATN(1e20)='
  657.         _litstr    str2,'1e20'
  658.         _fstrval
  659.         _fset    fvar2
  660.         _fvarcpy    fvar1,fvar2
  661.         _fatn
  662.         _fvout
  663.         _out2stroff
  664.         _prstr    str1
  665.  
  666.         jsr    nextPage
  667.  
  668.         _write    13,'Testing floating-point error trapping:',\
  669.             13,'  12.34/1 = '
  670.         _fset    fvar1,#12.34
  671.         _fdiv    ,#1
  672.         jsr    aserror
  673.         _write    13,'  12.34/0 = '
  674.         _fdiv    ,#0
  675.         jsr    aserror
  676.         _write    13,'  LOG(10) = '
  677.         _fset    fvar1,#10
  678.         _flog
  679.         jsr    aserror
  680.         _write    13,'  LOG(-1) = '
  681.         _fset    fvar1,#-1
  682.         _flog
  683.         jsr    aserror
  684.         _write    13,'    20^20 = '
  685.         _fset    fvar1,#20
  686.         _fv2con    ,#20
  687.         jsr    aserror
  688.         _write    13,'    30^30 = '
  689.         _fset    fvar1,#30
  690.         _fv2con    ,#30
  691.         jsr    aserror
  692.  
  693.         _write    13,13,13,'Testing floating-point array handling.'
  694.         _write    13,'The array is 5x6x7 words.'
  695.  
  696.         _array    #$4000,#5,#5,#6,#7    ;First #5 means elements are
  697.                         ;5 bytes each.
  698.         _index    #<1,#<2
  699.         _fset    fvar1,#12.34
  700.         _putl    ,#<3
  701.  
  702.         _index    ,#<4
  703.         _fset    fvar1,#56.78
  704.         _put    ,#<1
  705.  
  706.         _write    13,13,'array(1,2,3)='
  707.         _index    ,#<2
  708.         _getl    fvar1,#<3
  709.         _fvout
  710.  
  711.         _write    13,'array(1,4,1)='
  712.         _index    ,#<4
  713.         _get    fvar1,#<1
  714.         _fvout
  715.  
  716.         jsr    nextPage
  717.  
  718.         jmp    start
  719. tempx        dc.b    0
  720. tempy        dc.b    0
  721.  
  722. aserror        bcc    @noerr
  723.         pha
  724.         _write    'AppleSoft error $'
  725.         _hexpad    #'0'
  726.         pla
  727.         _hexoutl
  728.         rts
  729. @noerr        _fvout
  730.         rts
  731.  
  732.  
  733. floatdata    _asc2fp    #16
  734.         _asc2fp    #.5
  735.  
  736. intdata        dc.w    123
  737.  
  738. strdata        _cstr    13,13,'Testing _readend, _restore, ',\
  739.             '_readstr, and _strval:  '
  740.         _cstr    '12345'
  741.         _cstr    13,'Testing _midstrval:  '
  742.         _cstr    'Testing _prleftstr and _prmidstr.'
  743.         _cstr    'Testing _leftstrcpy and _midstrcpy.'
  744.         _cstr    'Testing _strcpy.'
  745.         _cstr    0,'Testing _leftstrcat and _midstrcat.'
  746.         _cstr    'Testing '
  747.         _cstr    '_strcat.'
  748.         _cstr    13,'Testing _strchr.'
  749.  
  750. nextPage        lda    #22
  751.         sta    cv
  752.         _write    13,'  <<< Press any key to go on (or ESC to quit). >>>'
  753.         bit    $C010
  754. @a        inc    rndl
  755.         bne    @b
  756.         inc    rndh
  757. @b        lda    $C000
  758.         bpl    @a
  759.         bit    $C010
  760.         cmp    #$9B
  761.         beq    @quit
  762.         jmp    home
  763. @quit        jsr    home
  764.         jsr    mli
  765.         dc.b    $65
  766.         dc.w    @quitlist
  767. @quitlist    dc.b    4
  768.         dc.w    0,0,0
  769.  
  770.         endp
  771.  
  772.         END
  773.  
  774.